package com.stephen.bp.service;

import java.util.Date;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.stephen.bp.mapper.RecordMapper;
import com.stephen.bp.model.Record;
import com.stephen.bp.model.Room;
import org.springframework.stereotype.Service;

/**
 * @author qiuwenwei
 */
@Service
public class RecordService extends ServiceImpl<RecordMapper, Record> {
    public void record(Room room) {
        Record record = new Record();
        record.setRoomId(room.getRoomId());
        record.setAUser(room.getAUser().getUsername());
        record.setBUser(room.getBUser().getUsername());
        record.setCreateTime(new Date());
        record.format(room);
        this.save(record);
    }
}
